<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<script src="danddms.js"></script>

	
	<style type="text/css">
		*{padding:0;margin:0;font-family:微软雅黑;}
		.divv{font-family:微软雅黑;text-align: center;}
	</style>
	<title>TA-jsp-大学物理实验-九、实验14 衍射光栅</title>
</head>

<body><!--可见部分开始-->
	<nav class="navbar navbar-default navbar-fixed-top"><!--顶部栏-->
		<div class="container-fluid"><!--this is the nav-->
			
			<div class="navbar-header"><!--brand and phone nav-->
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">TriAlley</a>
			</div>
			
			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"><!--this is our-->
				<ul class="nav navbar-nav">
					<li class="active"><a href="#">项目链接</a></li>
				</ul>
			</div>
		</div>
	</nav>
	
	<br/>
	<br/>
	<br/>

	<div  class="text-center">	<!--绘制操作界面-->
		<table class="table table-condensed">
			<thead>
				<tr>
					<th scope="row"></th>
					<th>颜色</th>
					<th>λ标/nm</th>
					<th>θk</th>
					<th>θ-k</th>
					<th>θ'k</th>
					<th>θ'-k</th>
					<th></th>
					<th></th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<th scope="row">1</th>
					<th>颜色</th>
					<th><input style="padding:0;" id="lb" class='form-control' type="text" placeholder=""/></th>
					<th><input id="sk" class='form-control' type="text" placeholder=""/></th>
					<th><input id="sfk" class='form-control' type="text" placeholder=""/></th>
					<th><input id="spk" class='form-control' type="text" placeholder=""/></th>
					<th><input id="spfk" class='form-control' type="text" placeholder=""/></th>
					<th></th>
					<th></th>
					<th></th>
					<th><submit class="submit btn btn-success" onclick= "cal()" >确定</submit></th>
				<tr/>
			</tbody>
		</table>
	</div>
</body><!--可见部分结束-->

<script>
	function cal() {
		//转换数字格式，度分秒>度小数
		var lb = parseFloat(document.getElementById("lb").value)
		var sk = parseFloat(gpsToDu(document.getElementById("sk").value+"00\'\'")[1])
		var sfk = parseFloat(gpsToDu(document.getElementById("sfk").value+"00\'\'")[1])
		var spk = parseFloat(gpsToDu(document.getElementById("spk").value+"00\'\'")[1])
		var spfk = parseFloat(gpsToDu(document.getElementById("spfk").value+"00\'\'")[1])
		alert(sk)
		//计算所要求的三个数
        var pjz= ((Math.abs(sk-sfk)+Math.abs(spk-spfk))/4)
        var lc= (Math.abs((5000/3)*Math.sin(pjz*(Math.PI / 180))))
        var E= (Math.abs(lb-lc)/lb*100)
        alert(pjz)
		alert("您的平均φk："+formatDegree(pjz)+"   您的λ测/nm："+lc+"  您的E："+E+"\%")
    } 
</script>
</html>
